Ext.define('Holo.model.AppTrip', {
    extend: 'Ext.data.Model',

    fields: [
        {
            name: 'id',
            type: 'int'
        },
        {
            name: 'app_id',
            type: 'int'
        },
        {
            name: 'trip_id',
            type: 'int'
        },
        {
            name: 'list_order',
            type: 'int'
        },
        {
            name: 'user_id',
            type: 'int'
        },
    ],
    
    sortInfo: {
            field: 'list_order',
            direction: 'ASC'
    },
    sortOnLoad :true,
    
    
    proxy: {
        type: 'ajax',
        api: {
            create: 'database/controller.php?MODEL=apptrip&ACTION=ADDALL',
            read: 'database/controller.php?MODEL=apptrip&ACTION=LST',
            update: 'database/controller.php?MODEL=apptrip&ACTION=UPD',
            destroy: 'database/controller.php?MODEL=apptrip&ACTION=DEL'
        },
        
        reader: {
            type: 'json',
            root: 'data'
        },
        
        writer : {
            type: 'json',
        	allowSingle  : false,
        	root: 'data',
        	encode : true
        }
    }
});